//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Collections;
using System.Collections.Generic;

namespace OpenLS.Spreadsheet.Expressions
{
    abstract class ExpressionArrayBase: IArray
    {
        public  IEnumerator<object> GetEnumerator()
        {
            for (int row = 0; row < RowCount; row++)
            {
                for (int column = 0; column < ColumnCount; column++)
                {
                    yield return this[row, column];
                }
            }
        }
        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }

        public abstract object this[int row, int column] { get; }
        public abstract int RowCount { get; }
        public abstract int ColumnCount { get; }
    }
}